import React, { Component } from 'react'

export class StateSon extends Component {
    constructor(props){
        super(props)
        console.log(props);
        console.log("子组件 constructor");
        this.state={
            arr:props.arr
        }
    }

    componentDidMount(){
        console.log("子组件 componentDidMount");
    }

    componentDidUpdate(){
        console.log("子组件 componentDidUpdate");
    }
    

    componentWillUnmount(){
        console.log("子组件 componentWillUnmount");
    }
  render() {
      console.log("子组件 render");
    return (
      <div>
          StateSon
          {
              this.state.arr.map(item=>(<div key={item}>{item}</div>))
          }
        </div>
    )
  }
}

export default StateSon